﻿@{
    Layout = null;
    var callBackFunc = Model.CallBack + "(data);";
    var url = string.Format("{0}?width={1}&height={2}", Model.Url, Model.Width, Model.Height);
}
@model Web.Controllers.FileUploadController.Model

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../../Content/jquery/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="../../Content/swfupload/swfupload.js" type="text/javascript"></script>
    <script src="../../Content/swfupload/handlers.js" type="text/javascript"></script>
    <script type="text/javascript">
        var loader;

        $(function () {
            loader = initUploader("@Html.Raw(url)", "@Model.SizeLimit", "@Model.Ext", "@Model.BtnName");
        });

        function onUploadSuccess(data) {
          @(callBackFunc)
        }
    </script>
    <style type="text/css">
        * {
            margin: 0px;
            padding: 0px;
        }

        table {
            width: 100%;
        }

        #percentback {
            height: 25px;
            width: 98%;
            border: 1px solid #cccccc;
            background: #f9fafd;
            font: 14px/20px Microsoft YaHei;
            border-radius: 4px;
            overflow: hidden;
        }

        #uploadfilename {
            margin-top: 1px;
            padding-left: 10px;
            display: inline-block;
            font-size: 11px;
            background-color: #f9fafd;
            overflow: hidden;
        }

        #percent {
            margin-top: 2px;
            width: 0%;
            height: 2px;
            background-color: #4EB84E;
        }
    </style>
</head>
<body>
    <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                @if (Model.ShowPathCtrl == false)
                {
                    <td style="display: none;">
                        <div id="percentback">
                            <span id="uploadfilename"></span>
                            <div id="percent">
                            </div>
                        </div>
                    </td>
                }
                else
                {
                    <td>
                        <div id="percentback">
                            <span id="uploadfilename"></span>
                            <div id="percent">
                            </div>
                        </div>
                    </td>
                }
                <td align="right" style="width: 80px;">
                    <span id="spanButtonPlaceholderSingle">上传</span>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>
